Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bridge indexer #17870

Merged
merged 13 commits into from
May 24, 2024
Merged

Bridge indexer #17870

merged 13 commits into from
May 24, 2024

Conversation

Bridgerz
Copy link
Contributor

Description

Adds the sui-bridge-indexer crate.

Copy link

vercel bot commented May 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 23, 2024 3:09pm
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview May 23, 2024 3:09pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview May 23, 2024 3:09pm
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview May 23, 2024 3:09pm

txn_hash bytea NOT NULL,
gas_usage BIGINT NOT NULL,
data_source TEXT NOT NULL,
PRIMARY KEY(chain_id, nonce, status)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is status part of the key? that seems excessive to me, thoughts?
I would expect the table to be used with a key that represents everything that has happened to a given bridged asset, as such all statuses should be returned no?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually reading some more about composite key I see that we cannot use the chain_id, nonce only (I guess we have multiple entries for sui?).
However I do wonder what is the value of this primary key and thinking that some proper indexes may be better.
Unless I do not understand how a primary key is used or can be used here

@@ -0,0 +1,26 @@
CREATE TABLE token_transfer_data
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we have more info into this table so that it can be queried on its own?
for instance we have no timestamp which makes time query only possible with a join (e.g. highest amount in the past week).
Also maybe sender and recipient address are more interesting indexes?

Copy link
Contributor

@dariorussi dariorussi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's get this in a clean up and fix on later PRs

@dariorussi dariorussi merged commit 5137c6e into main May 24, 2024
48 checks passed
@dariorussi dariorussi deleted the bridge-indexer branch May 24, 2024 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants